import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    //根路由不显示特有内容(直接对应App.vue)
    path:'/',
    redirect: '/msite'
  },
  // 位置模块
  {
    path:'/msite',
    name:'msite',
    component: ()=> import('../pages/msite'),
    meta:{
      keepAlive: true
    }
  },
  {
    path:'/city/:id',
    name:'city',
    component: ()=> import('../pages/city')
  },
  // 登录
  {
    path:'/login',
    name:'login',
    component: ()=> import('../pages/login')
  },
  {
    path:'/home',
    name:'home',
    component: ()=> import('../pages/home'),
    meta:{
      showTabbar:true,
    }
  },
  {
    path:'/search',
    name:'search',
    component: ()=> import('../pages/search'),
    meta:{
      showTabbar:true,
    }
  },
  {
    path:'/order',
    name:'order',
    component: ()=> import('../pages/order'),
    meta:{
      showTabbar:true,
    }
  },
  {
    path:'/food',
    name:'food',
    component: ()=> import('../pages/food')
  },
  {
    path:'/shop',
    name:'shop',
    component: ()=> import('../pages/shop'),
    children:[
      {
        path:'checkout',
        name:'checkout',
        component: ()=> import('../pages/checkout')
      },
    ]
  },
  

   // 我的模块
  {
    path:'/profile',
    name:'profile',
    component: ()=> import('../pages/profile'),
    meta:{
      showTabbar:true
    },
  },
  {
    path:'/profile/account',
    name:'account',
    component: ()=> import('../pages/profile/account'),
  },


  {
    path:'*',
    component: ()=> import('../pages/notFound'),
  },
  
  
]

const router = new VueRouter({
  mode:'hash',
  routes
})

export default router